/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "eventelement")
@NamedQueries({
    @NamedQuery(name = "Eventelement.findAll", query = "SELECT e FROM Eventelement e"),
    @NamedQuery(name = "Eventelement.findByIdeventelement", query = "SELECT e FROM Eventelement e WHERE e.ideventelement = :ideventelement"),
    @NamedQuery(name = "Eventelement.findBySamplingeffort", query = "SELECT e FROM Eventelement e WHERE e.samplingeffort = :samplingeffort"),
    @NamedQuery(name = "Eventelement.findByEventdate", query = "SELECT e FROM Eventelement e WHERE e.eventdate = :eventdate"),
    @NamedQuery(name = "Eventelement.findByVerbatimeventdate", query = "SELECT e FROM Eventelement e WHERE e.verbatimeventdate = :verbatimeventdate"),
    @NamedQuery(name = "Eventelement.findByFieldnumber", query = "SELECT e FROM Eventelement e WHERE e.fieldnumber = :fieldnumber"),
    @NamedQuery(name = "Eventelement.findByFieldnote", query = "SELECT e FROM Eventelement e WHERE e.fieldnote = :fieldnote"),
    @NamedQuery(name = "Eventelement.findByEventremark", query = "SELECT e FROM Eventelement e WHERE e.eventremark = :eventremark"),
    @NamedQuery(name = "Eventelement.findByEventtime", query = "SELECT e FROM Eventelement e WHERE e.eventtime = :eventtime")})
public class Eventelement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ideventelement")
    private Integer ideventelement;
    @Column(name = "samplingeffort")
    private String samplingeffort;
    @Column(name = "eventdate")
    @Temporal(TemporalType.DATE)
    private Date eventdate;
    @Column(name = "verbatimeventdate")
    private String verbatimeventdate;
    @Column(name = "fieldnumber")
    private String fieldnumber;
    @Column(name = "fieldnote")
    private String fieldnote;
    @Column(name = "eventremark")
    private String eventremark;
    @Column(name = "eventtime")
    @Temporal(TemporalType.TIME)
    private Date eventtime;
    @OneToMany(mappedBy = "eventelement", fetch = FetchType.LAZY)
    private List<Specimen> specimenList;
    @JoinColumn(name = "idsamplingprotocol", referencedColumnName = "idsamplingprotocol")
    @ManyToOne(fetch = FetchType.LAZY)
    private Samplingprotocol samplingprotocol;
    @JoinColumn(name = "idhabitat", referencedColumnName = "idhabitat")
    @ManyToOne(fetch = FetchType.LAZY)
    private Habitat habitat;

    public Eventelement() {
    }

    public Eventelement(Integer ideventelement) {
        this.ideventelement = ideventelement;
    }

    public Integer getIdeventelement() {
        return ideventelement;
    }

    public void setIdeventelement(Integer ideventelement) {
        this.ideventelement = ideventelement;
    }

    public String getSamplingeffort() {
        return samplingeffort;
    }

    public void setSamplingeffort(String samplingeffort) {
        this.samplingeffort = samplingeffort;
    }

    public Date getEventdate() {
        return eventdate;
    }

    public void setEventdate(Date eventdate) {
        this.eventdate = eventdate;
    }

    public String getVerbatimeventdate() {
        return verbatimeventdate;
    }

    public void setVerbatimeventdate(String verbatimeventdate) {
        this.verbatimeventdate = verbatimeventdate;
    }

    public String getFieldnumber() {
        return fieldnumber;
    }

    public void setFieldnumber(String fieldnumber) {
        this.fieldnumber = fieldnumber;
    }

    public String getFieldnote() {
        return fieldnote;
    }

    public void setFieldnote(String fieldnote) {
        this.fieldnote = fieldnote;
    }

    public String getEventremark() {
        return eventremark;
    }

    public void setEventremark(String eventremark) {
        this.eventremark = eventremark;
    }

    public Date getEventtime() {
        return eventtime;
    }

    public void setEventtime(Date eventtime) {
        this.eventtime = eventtime;
    }

    public List<Specimen> getSpecimenList() {
        return specimenList;
    }

    public void setSpecimenList(List<Specimen> specimenList) {
        this.specimenList = specimenList;
    }

    public Samplingprotocol getSamplingprotocol() {
        return samplingprotocol;
    }

    public void setSamplingprotocol(Samplingprotocol samplingprotocol) {
        this.samplingprotocol = samplingprotocol;
    }

    public Habitat getHabitat() {
        return habitat;
    }

    public void setHabitat(Habitat habitat) {
        this.habitat = habitat;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ideventelement != null ? ideventelement.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Eventelement)) {
            return false;
        }
        Eventelement other = (Eventelement) object;
        if ((this.ideventelement == null && other.ideventelement != null) || (this.ideventelement != null && !this.ideventelement.equals(other.ideventelement))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Eventelement[ideventelement=" + ideventelement + "]";
    }

}
